Skip to content

Add sampling logic#805

Merged
quinnmil merged 21 commits intomasterfrom
804-add-sampling-logic
Jan 15, 2025
Merged

Add sampling logic#805
quinnmil merged 21 commits intomasterfrom
804-add-sampling-logic

Conversation

@quinnmil
Copy link
Copy Markdown
Contributor

@quinnmil quinnmil commented Jan 3, 2025

Changes

  • Adds Sampler class which handles:
  • Loading sampling configuration
  • Finding the matching job/controller pattern for a given operation name. Update: This has been simplified to just use a startswith to be consistent with how the current ignore_path logic works.
  • get sampling rate for matched job/controller, make sampling decision based on priority order.
  • Updates Config module to accept new configuration options: sample_endpoint_rate and sample_job_rate which work as a endpoint/job catchall, with the fallback value still being the global sample_rate.

@quinnmil quinnmil linked an issue Jan 3, 2025 that may be closed by this pull request
@quinnmil quinnmil changed the base branch from master to 802-parse-new-configuration-options January 3, 2025 23:16
@quinnmil quinnmil marked this pull request as draft January 3, 2025 23:16
@quinnmil quinnmil force-pushed the 804-add-sampling-logic branch from b135dc8 to 52363c2 Compare January 6, 2025 20:06
@quinnmil quinnmil marked this pull request as ready for review January 6, 2025 20:06
Base automatically changed from 802-parse-new-configuration-options to master January 6, 2025 20:08
@quinnmil quinnmil force-pushed the 804-add-sampling-logic branch from 52363c2 to cdd1345 Compare January 6, 2025 20:11
@quinnmil quinnmil force-pushed the 804-add-sampling-logic branch from cdd1345 to d396107 Compare January 6, 2025 20:14
@quinnmil quinnmil force-pushed the 804-add-sampling-logic branch from 08eb143 to f9d92f2 Compare January 7, 2025 21:43
Comment thread src/scout_apm/core/sampler.py Outdated
Comment thread src/scout_apm/core/sampler.py
Comment thread src/scout_apm/core/sampler.py Outdated
Comment thread src/scout_apm/core/sampler.py Outdated
@quinnmil quinnmil merged commit e121145 into master Jan 15, 2025
@quinnmil quinnmil deleted the 804-add-sampling-logic branch January 15, 2025 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add sampling logic

2 participants